package com.learner.blog.repository;

import com.learner.pojo.blog.BlogType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
* @author ice2020x
* @Date: 2023/2/23
* @Description: 博客分类
**/
@Repository
public interface CategoryRepository extends JpaRepository<BlogType,Long> {

    @Modifying
    @Query(value = "SELECT * FROM blog_type ORDER BY post_count DESC",nativeQuery = true)
    List<BlogType> findAllCateList();
}
